home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / mac / Chapter Tutorials / CaseStudies / ch14.CSAA / csaaDrive2.dir / 00001.ls next >
Encoding:
Text File  |  1996-08-28  |  2.9 KB  |  100 lines

  1. global gTargetList, gBaseURL, gHistory, gEyeBallChan, gSegStart, gNextRandTime, gButtonInks, gRearViewChan, gCarByeSnd, gBigMapChan, gAlertChan, gVioConChan, gTerrainChan, oldMousePoint, oldAngle, gRealPageList, gReadyToGo
  2.  
  3. on startMovie
  4.   setConstants()
  5.   initSprites()
  6.   set the visible of sprite 23 to 1
  7. end
  8.  
  9. on setConstants
  10.   set gTargetList to ["getaways.html", "about.html", "whatsnew.html", "travel.html", "join.html", "insurance.html", "education.html", "autoservices.html", "csaakids.html"]
  11.   set gRealPageList to ["/getaways/", "/about/", "/whatsnew/", "/travel/", "/join/", "/insurance/", "/education/", "/autoservices/", "/csaakids/"]
  12.   if not gHistory then
  13.     set gHistory to []
  14.   end if
  15.   set gButtonInks to [6, 33]
  16.   set gRearViewChan to 16
  17.   set gTerrainChan to [2, 3, 5, 6, 7, 11, 12]
  18.   set gAlertChan to [46, 47, 48]
  19.   set gCarByeSnd to "carBy"
  20.   set gBigMapChan to 24
  21.   set gEyeBallChan to 20
  22.   set gVioConChan to 45
  23.   set gSegStart to the ticks
  24.   set gNextRandTime to 600 + random(800)
  25.   set the randomSeed to the ticks
  26. end
  27.  
  28. on initSprites
  29.   allSprites(-1, 1, 1, gBigMapChan - 1)
  30.   allSprites(0, 0, gBigMapChan, 42)
  31.   puppetSprite(gEyeBallChan, 1)
  32.   puppetSprite(gEyeBallChan + 1, 1)
  33.   set the visible of sprite 23 to 1
  34.   set the visible of sprite gRearViewChan to 0
  35.   preLoad(label("tween"), label("tween") + 4)
  36.   preLoadCast(the number of member "weekgtaway-viol", the number of member "kdsclb-viol")
  37.   allSprites(-1, 0, getAt(gAlertChan, 1), getLast(gAlertChan))
  38.   set oldMousePoint to [:]
  39.   set oldAngle to [:]
  40. end
  41.  
  42. on conformCastNames
  43.   set vStart to the number of member "viol"
  44.   set bStart to the number of member "bill"
  45.   set oldDelim to the itemDelimiter
  46.   set the itemDelimiter to "-"
  47.   set castIndex to 0
  48.   if (bStart > 0) and (vStart > 0) then
  49.     repeat with i in gTargetList
  50.       set shortName to item 1 of i
  51.       set the name of cast (vStart + castIndex) to shortName & "-viol"
  52.       set the name of cast (bStart + castIndex) to shortName & "-bill"
  53.       set castIndex to castIndex + 1
  54.     end repeat
  55.   end if
  56.   set the itemDelimiter to oldDelim
  57. end
  58.  
  59. on setTargetPage thePageNum
  60.   global gTindex, gNextFrame
  61.   if integerp(thePageNum) then
  62.     set gTindex to thePageNum
  63.   else
  64.     if not gNextFrame or (gNextFrame = getLast(gTargetList)) then
  65.       set thePageNum to 1
  66.     else
  67.       set thePageNum to getPos(gTargetList, gNextFrame) + 1
  68.     end if
  69.   end if
  70.   set gNextFrame to getAt(gTargetList, thePageNum)
  71.   puppetSprite(gVioConChan, 1)
  72.   go(label("tween"))
  73. end
  74.  
  75. on idle
  76.   global gReadyToGo
  77.   if NetDone() = 1 then
  78.     set gReadyToGo to 1
  79.   end if
  80.   if not (the visible of sprite gBigMapChan) then
  81.     followEyes()
  82.   end if
  83. end
  84.  
  85. on enterFrame
  86.   global gSegStart, gNextRandTime
  87.   if the visible of sprite gBigMapChan = 1 then
  88.     doMap("animate")
  89.     checkMapRolz()
  90.   else
  91.     if the ticks > (gSegStart + gNextRandTime) then
  92.       animateRearView()
  93.     end if
  94.   end if
  95. end
  96.  
  97. on stopMovie
  98.   allSprites(0, 1)
  99. end
  100.